package alg1_baseModel;
import edu.princeton.cs.algs4.*;

public class InputOutput {
    public static void main(String[] args) {
        double sum = 0;
        int cnt = 0;
        while (!StdIn.isEmpty()){
            //读取一个数并计算累计之和
            sum += StdIn.readDouble();
            cnt++;
        }
        double avg = sum/cnt;
        StdOut.printf("sum:%f , cnt:%d\n",sum,cnt);
        StdOut.printf("Average is %.5f\n",avg);
    }
}
